
import java.util.Scanner;

class PARIDADE {

    static Scanner entrada = new Scanner(System.in);

    public static void main(String[] args) {

        int I;
        String B;

        while ((I = entrada.nextInt()) != 0) {
            int P = 0;
            B = Integer.toBinaryString(I);

            for (int i = 0; i < B.length(); i++) {
                if (String.valueOf(B.charAt(i)).equalsIgnoreCase("1")) {
                    P++;
                }
            }
            System.out.println("The parity of " + B + " is " + P + " (mod 2).");
        }
    }
}
